//
//  XMAuthorization.h
//  XMJJ_zml
//
//  Created by 丁浩 on 2025/6/3.
//

#import <Foundation/Foundation.h>
@class XMAuthorization;

NS_ASSUME_NONNULL_BEGIN

typedef enum : NSUInteger {
    /// 授权成功（第一次授权允许及已授权）
    XMAuthorizationStatusSuccess,
    /// 授权失败（已拒绝）
    XMAuthorizationStatusFail,
    /// 未知（受限制）
    XMAuthorizationStatusUnknown,
} XMAuthorizationStatus;

typedef void(^XMAVAuthorizationBlock)(XMAuthorization *authorization, XMAuthorizationStatus status);
typedef void(^XMPHAuthorizationBlock)(XMAuthorization *authorization, XMAuthorizationStatus status);

@interface XMAuthorization : NSObject

/** 类方法创建 */
+ (instancetype)authorization;
/** 打印信息，默认为：NO */
@property (nonatomic, assign) BOOL openLog;

/** 相机授权回调方法 */
- (void)AVAuthorizationBlock:(XMAVAuthorizationBlock)block;
/** 相册授权回调方法 */
- (void)PHAuthorizationBlock:(XMPHAuthorizationBlock)block;

@end

NS_ASSUME_NONNULL_END
